<h1>Line</h1>

<p>Line defines a straight line drawn from the current drawing point. Once the 
line is drawn, the end of the line is now the current drawing point.</P>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">type</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">2</td>
<td>Identifies a curve or a line when included in the drawing commands that 
describe a shape. 0 = style information, 2 = curve or 3 = line.</td>
</tr>

<tr>
<td nowrap valign="top">size</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">4</td>
<td>The number of bits in each x and y coordinate used to describe the curve. The 
actual number of bits is size+2 which increases the dynamic range of the coordinates
being encoded.</td>
</tr>

<tr>
<td nowrap valign="top">hasXY</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>If set the line specifies an x and y coordinate.</td>
</tr>

<tr>
<td nowrap valign="top">hasY</td>
<td nowrap valign="top">boolean</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>If hasXY is not set then this field indicates whether the line
is vertical (1) or horizontal (0). This allows only the y or y coordinate 
respectively to be specified.</td>
</tr>

<tr>
<td nowrap valign="top">x</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">size+2</td>
<td>The x-coordinate, relative to the current drawing point, of the line end.</td>
</tr>

<tr>
<td nowrap valign="top">y</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">size+2</td>
<td>The y-coordinate, relative to the current drawing point, of the line end.</td>
</tr>

</table>

<p>The relative coordinates are specified in twips (where 20 twips = 1 pixel). 
Using an increment of 2 to the size field gives a range for expressing relative
coordinates of -65536..65535.</p>

<p>Lines are drawn with rounded corners and line ends. Different join and line 
end styles can be created by drawing line segments as a sequence of filled shapes. 
With 1 twip equal to 1/20th of a pixel this technique can easily be used to draw 
the narrowest of visible lines.</p>

<h2>History</h2>

<p>The Line data structure represents the StraightEdge record from the Macromedia 
Flash (SWF) File Format Specification. It was introduced in Flash 1.</p>
